import request from '../axios'

/**
 * 支付页面
 */
export function index(data) {
    return request({
        url: 'pay/index',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    })
}

/**
 * 支付参数paytoken
 */
export function paytoken(data) {
    return request({
        url: 'pay/paytoken',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    })
}

/**
 * 生成支付二维码
 */
export function paycode(data) {
    return request({
        url: 'pay/paycode',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    })
}

/**
 * 机器扫码传参数解密
 */
export function backpay(data) {
    return request({
        url: 'pay/backpay',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    })
}

/**
 * 查询订单是否支付成功
 */
export function searchorder(data) {
    return request({
        url: 'pay/searchorder',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    })
}
